<html>
<head><title>Dashboard configuration</title></head>
<script type="text/javascript" src="tabbed_app.js"></script>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
  var area = document.getElementById("dashboard");
  localStorage["dashboard"] = area.value;
  // Update status to let user know options were saved.
  var status = document.getElementById("status");
  status.innerText = "Options Saved.";
  setTimeout(function() {
    status.innerText = "";
  }, 750);
}
// TODO(wad) Add a reset options.
function restore_options() {
  var dash = loadDashboard();
  var area = document.getElementById("dashboard");
  area.value = JSON.stringify(dash, null, 2);
}
</script>
<body onload="restore_options()">
<p>Dashboard configuration (JSON):</p>
<div id="status"></div>
<textarea id="dashboard" style="width: 90%; height: 90%;">
</textarea>
<br>
<button onclick="save_options()">Save</button>
</body>
</html>
